<template>
  <div>
    <h2 class="hometitle"><p>标签云</p></h2>
    <el-button  class="tag_btn" type="warning" plain  v-for="(item,index) in getHotTag" :key="item.uid">
      <font @click="fingByTagInfo(item.uid)">{{item.content}}</font>
    </el-button>
  </div>
</template>

<script>
  import axios from "axios";
  export default {
    name: "tagcloud",
    data() {
      return {
        getHotTag: [], //标签列表
        type:[
          {
            name:'success'
          },
          {
            name:'info'
          },
          {
            name:'danger'
          },
          {
            name:'warning'
          }
        ]
      };
    },

    methods: {
      fingByTagInfo:function(uid){
        this.$router.push('/tag/'+uid);
      },
      getHotTags:function () {
        var _this=this;
        axios.get("/api/blogs/getHotTag").then(function (res) {
          console.log(res.data)
          _this.getHotTag=res.data
        })
      },
    },
    mounted() {
      this.getHotTags();
    }
  };
</script>

<style>
  .tag_btn{
    border-radius: 8px;
    float: left;
    margin-left: 10px;
    margin-top: 10px;
  }
  .tag_btn:hover{
    border-radius: 0px;
  }
  .hometitle{
    margin-bottom: 20px;
  }
</style>

